package com.syezon.wifikey.utils;

import android.os.Environment;


import java.io.File;

/**
 * Created by Administrator on 2018/9/13.
 */

public class FileUtiils {
    public static void changeFileName() {
        File externalStorageDirectory = Environment.getExternalStorageDirectory();
        File imgDir = new File(externalStorageDirectory, "/image_manager_disk_cache");
        if (imgDir.isDirectory()) {
            String[] list = imgDir.list();
            for (int i = 0; list != null && i < list.length; i++) {
                String fileName = list[i];
                File itemFile = new File(imgDir, fileName);
                File renameFile = new File(imgDir, fileName.hashCode() + ".png");
                itemFile.renameTo(renameFile);
            }
        }
    }
}
